<?php
class AnalyticsController extends AppController{
        var $name = 'Analytics';
        
        var $uses = array('Analytic');
        var $components = array('Utils');
        
		function beforeRender(){
			parent::beforeRender();
			$this->set('menu_parent', 'Tools');			
			$this->set('menu_subactive', 'Visitor_Analytics');		
		}       

		function admin_index(){
			$limit_time = time() - 300;
			
			if($today = $this->Analytic->getToday());
			{
				$this->set("today",$today);
			}
			
			if($yesterday = $this->Analytic->getYesterday());
			{
				$this->set("yesterday",$yesterday);
			}
			
			$start = null;
			$end = null ;
			$this->Utils->getWeekRange($start,$end, 0);
			if($thisweek = $this->Analytic->getThisWeek($start,$end));
			{
				$this->set("thisweek",$thisweek);
			}
			
			if($thismonth = $this->Analytic->getThisMonth());
			{
				$this->set("thismonth",$thismonth);
			}
			
		}

		
}